#!/bin/bash

echo "启动 We Easy 微信小程序后端服务..."
echo

# 检查Java环境
echo "检查Java环境..."
if ! command -v java &> /dev/null; then
    echo "错误: 未找到Java环境，请先安装Java 17或更高版本"
    exit 1
fi

java -version

echo
echo "编译项目..."
mvn clean compile -DskipTests
if [ $? -ne 0 ]; then
    echo "错误: 项目编译失败"
    exit 1
fi

echo
echo "启动应用..."
mvn spring-boot:run -pl wx-app
